<template>
    <view class="content" :style="{height:height+'px'}">
        <view class="title">您的II类账号</view>
        <view class="title" style="color: #479EEE;display: flex;justify-content:space-between">
            <text>{{userData.card2}}</text>
            <text v-if="!balance" @click="getData()">查看余额</text>
            <view v-else style="line-height: 40upx;font-size: 24upx">
                <text>可用余额(元):{{balance.accountBalance}}</text><br/>
                <text>冻结余额(元):{{balance.holdBalance}}</text>
            </view>
        </view>
        <view class="but-wrap">
            <button type="warn"  class="sub-button" @click="goUrl('receive')">
                转入
            </button>
            <button type="warn"  class="sub-button" @click="goUrl('send')">
                转出
            </button>
            <button type="warn"  class="sub-button" @click="goUrl('cardList')">
                账户变更
            </button>
            <button type="warn"  class="sub-button" @click="goUrl('voucher')">
                查询
            </button>
        </view>
        <view class="msg">
            温馨提示:<br/>
            1.点击“转入”，完成I类账户向I类账户的资金转入<br/>
            2.点击“转出”，完成I类账户向|类账户的资金转出<br/>
            3.点击“账户变更”，完成l类账户变更和已绑定类账户的解绑<br/>
            4.转入完成后，请您按照房产公司要求，尽快完成诚e金缴存
        </view>
    </view>
</template>

<script>
    import API from '../../common/api.js';
    export default {
        components: {},
        data() {
            return {
                height: uni.getSystemInfoSync().windowHeight,
                userData:JSON.parse(uni.getStorageSync('data')),
                balance:null
            }
        },
        onLoad() {

        },
        methods: {
            getData(){
                API.bankSincer({"token": uni.getStorageSync('token')}).then(res=>{
                    if(res.status==200){
                        this.balance=res.data
                    }else{
                        uni.showModal({
                            title: '提示',
                            content: '查看失败',
                            showCancel: false,
                        });
                    }
                })
            },
            goUrl(url){
                uni.navigateTo({
                    url: '../account/'+url
                });
            },
        }
    }
</script>

<style scoped>
    .content {
        height: 100%;
        /*padding-top: 20upx;*/
        background: #F3F3F3;
    }
    .title{
        background: white;
        color: #868686;
        line-height: 80upx;
        padding:0 20upx;
        font-size: 28upx;
        border-bottom: 1px solid rgba(227, 227, 227, 1);
    }
    .but-wrap{
        display: flex;;
        flex-wrap: wrap;
    }
    button{
        width: 49%;
        margin-top:30upx;
        background: #D14F43;
        border-radius: 4upx;
    }
    .msg{
        font-size:32upx;
        color: #7f5734;
        padding: 20upx;
        margin-top: 40upx;
        border-top: 2px solid rgba(227, 227, 227, 1);
        border-bottom: 2px solid rgba(227, 227, 227, 1);
        background: -webkit-linear-gradient(#e5d7cb, white); /* Safari 5.1 - 6.0 */
        background: -o-linear-gradient(#e5d7cb, white); /* Opera 11.1 - 12.0 */
        background: -moz-linear-gradient(#e5d7cb, white); /* Firefox 3.6 - 15 */
        background: linear-gradient(#e5d7cb, white); /* 标准的语法 */
    }
</style>
